home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
c
/
AmiVoGL_MDEV.lha
/
docs
/
vogl.doc
< prev
next >
Wrap
Text File
|
1994-04-19
|
51KB
|
2,047 lines
VOGL(3) C LIBRARY FUNCTIONS VOGL(3)
NAME
VOGL - A very ordinary GL Library.
DESCRIPTION
VOGL is a library of C routines which try to allow a pro-
grammer to write programs which can be moved to machines
which have the Silicon Graphics GL library on them. It is
based entirely on the VOGLE graphics library, and as a
result can handle circles, curves, arcs, patches, and
polygons in a device independent fashion. Simple hidden line
removal is also available via polygon backfacing. Access to
hardware text and double buffering of drawings depends on
the driver. There is also a FORTRAN interface but as it
goes through the C routines FORTRAN users are warned that
arrays are in row-column order in C. Both the long FORTRAN
names and the shortened six character names are supported.
People interested in using software text should see the
hershey library, HERSHEY(3).
Some routines are only available in VOGL. If you include
them in programs it is advisable to put #ifdef VOGL ...
#endif around them. The constant VOGL is defined whenever a
VOGL header file is included.
It should be noted that there are a number of routines that
take the type Angle for some of their parameters. All angles
specified this way are actually Integer Tenths Of Degrees.
(Don't ask!)
Include files.
There are two include files provided with vogl: vogl.h and
vodevice.h. The file vogl.h has the type definitions and
function interfaces, ideally it is included where you would
include gl.h on an SGI. The file vodevice.h has the devices
in it, and it is included where you would include device.h
on an SGI.
The following is a brief summary of the VOGL subroutines.
Device routines.
vinit(device)
Tell VOGL what the device is. This routine needs to be
called if the environment variable VDEVICE isn't set,
or if the value in VDEVICE is not to be used.
Fortran:
subroutine vinit(device, len)
character *(*) device
integer len
VOGL 1.0 Last change: 6 June 1991 1
VOGL(3) C LIBRARY FUNCTIONS VOGL(3)
C:
vinit(device);
char *device;
Note 1 :- Current available devices are:
tek - tektronix 4010 and compatibles
hpgl - HP Graphics language and compatibles
dxy - roland DXY plotter language
postscript - postscript devices
ppostscript - postscript devices (portrait mode)
sun - Sun workstations running sunview
X11 - X windows (SUN's Openwindows etc etc)
decX11 - the decstation (old) window manager
This is only included in case you need it.
apollo - Apollo workstations
NeXT - NeXTStep
hercules - IBM PC hercules graphics card
cga - IBM PC cga graphics card
ega - IBM PC ega graphics card
vga - IBM PC vga graphics card
sigma - IBM PC sigma graphics card.
Sun, X11, decX11, apollo, hercules, cga
and ega support double buffering.
Note 2 :- If device is a NULL or a null string the value
of the environment variable "VDEVICE" is taken as the
device type to be opened.
Note 3 :- after init it is wise to explicitly
clear the screen.
e.g.: in C
color(BLACK);
clear();
or in Fortran
call color(BLACK)
call clear
ginit()
Open the graphics device and do the basic initialisa-
tion. This routine is marked for obsolescence. The rou-
tine winopen (see below) should be used instead.
Fortran:
subroutine ginit
C:
ginit()
VOGL 1.0 Last change: 6 June 1991 2
VOGL(3) C LIBRARY FUNCTIONS VOGL(3)
winopen(title)
Open the graphics device and do the basic initialisa-
tion. This routine should be used instead of ginit.
Fortran:
subroutine winopen(title, len)
character*(*) title
integer len
C:
winopen(title)
char *title;
gexit()
Reset the window/terminal (must be the last VOGL rou-
tine called)
Fortran:
subroutine gexit
C:
gexit()
voutput(path)
Redirect output from *next* ginit to file given by
path. This routine only applies to devices drivers that
write to stdout e.g. postscript and hpgl.
Fortran:
subroutine voutput(path, len)
character*(*) path
integer len
C:
voutput(path)
char *path;
vnewdev(device)
Reinitialize VOGL to use a new device without changing
attributes, viewport etc. (eg. window and viewport
specifications)
Fortran:
subroutine vnewdev(device, len)
character *(*) device
integer len
C:
vnewdev(device)
VOGL 1.0 Last change: 6 June 1991 3
VOGL(3) C LIBRARY FUNCTIONS VOGL(3)
char *device;
getplanes()
Returns the number of bit planes (or color
planes) for a particular device. The number of colors
displayable by the device is then 2**(nplanes-1)
Fortran:
integer function getplanes()
C:
long
getplanes()
Routines For Setting Up Windows.
Some devices are basically window orientated - like sunview
and X11. You can give VOGL some information about the window
that it will use with these routines. These can make your
code very device dependent. Both routines take arguments
which are in device space. (0, 0) is the bottom left hand
corner in device space. To have any effect these routines
must be called before ginit or winopen. For the X11 device,
an entry may be made in your .Xdefaults file of the form
vogl.Geometry =150x500+550+50 (where you specify your
geometry as you please).
prefposition(x1, y1, x2, y2)
Specify the preferred position of the window opened by
the *next* winopen.
Fortran:
subroutine prefposition(x1, y1, x2, y2)
integer x1, y1, x2, y2
C:
prefposition(x1, y1, x2, y2)
long x1, y1, x2, y2
prefsize(width, height)
Specify the preferred width and height of the window
opened by the *next* winopen.
Fortran:
subroutine prefsize(width, height)
integer width, height
C:
prefsize(width, height)
long width, height;
VOGL 1.0 Last change: 6 June 1991 4
VOGL(3) C LIBRARY FUNCTIONS VOGL(3)
reshapeviewport
This is occasionally used in Iris GL if a R